home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2006 May
/
PCWMAY06.iso
/
Software
/
Freeware
/
First Page 2006 3.00
/
fp2006-final-3.00-setup.exe
/
{app}
/
Iscripts
/
Forms Misc
/
expanding-textbox.izs
< prev
next >
Wrap
Text File
|
2005-09-28
|
3KB
|
112 lines
<!NOWIZARD>
<!TITLE>Expanding Textbox
<!/TITLE>
<!DESCRIPTION>Automatically expands the size of a textbox to fit all of the entered text. Internet Explorer Only.<!/DESCRIPTION>
<!CATEGORY>Forms<!/CATEGORY>
<!SCRIPT>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL EXPANDING TEXTBOX:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Robert Khatchadourian (sonic890@hotmail.com) -->
<!-- Begin
function call_me(max_length) {
if((document.form1.mybox.value == null ) || (document.form1.mybox.value == "" )) document.form1.mybox.size = size;
if((document.form1.mybox.value.length >= size)&&(document.form1.mybox.value.length <= max_length)) document.form1.mybox.size = document.form1.mybox.value.length + 1;
else document.form1.mybox.size = size;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<form name="form1">
LastName: <input type="text" style="font-family: Terminal" name="mybox" maxlength="30" size="10" onFocus="setInterval('call_me(document.form1.mybox.maxLength)', 1)">
<!--/style needs to be a font that has a fixed size attribute like TERMINAL/-->
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Robert Khatchadourian (sonic890@hotmail.com) -->
<!-- Begin
var size = document.form1.mybox.size; //Global Variable keeps original size
// End -->
</script>
<!-- END OF SCRIPT -->
<!/SCRIPT>
<!PREVIEW>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL EXPANDING TEXTBOX:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Robert Khatchadourian (sonic890@hotmail.com) -->
<!-- Begin
function call_me(max_length) {
if((document.form1.mybox.value == null ) || (document.form1.mybox.value == "" )) document.form1.mybox.size = size;
if((document.form1.mybox.value.length >= size)&&(document.form1.mybox.value.length <= max_length)) document.form1.mybox.size = document.form1.mybox.value.length + 1;
else document.form1.mybox.size = size;
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<form name="form1">
LastName: <input type="text" style="font-family: Terminal" name="mybox" maxlength="30" size="10" onFocus="setInterval('call_me(document.form1.mybox.maxLength)', 1)">
<!--/style needs to be a font that has a fixed size attribute like TERMINAL/-->
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Robert Khatchadourian (sonic890@hotmail.com) -->
<!-- Begin
var size = document.form1.mybox.size; //Global Variable keeps original size
// End -->
</script>
<!-- END OF SCRIPT -->
<!/PREVIEW>
<!RELATED>NONE<!/RELATED>